﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using LogIn_App.Controllers;

namespace LogIn_App
{
    public partial class Form1 : Form
    {
        private readonly LogInController _logInController;


        public Form1(LogInController logInController)
        {
            _logInController = logInController;

            InitializeComponent();
        }

        private void LogIn_Btn_Click(object sender, EventArgs e)
        {
            var name = LogIn_TB.Text;
            var pswd = Passwd_TB.Text;

            if (_logInController.LogIn(name, pswd))
            {
                Success formSuccess = new Success();
                formSuccess.ShowDialog();
            }
            else
            {
                MessageBox.Show("error!!!");
            }
        }
    }
}
